import { Head } from './.nuxt/components.d';
import { resolve } from "path";
import { fileURLToPath } from "url";

// 配置的地址 [ https://nuxt.com/docs/api/configuration/nuxt-config ]
export default defineNuxtConfig({
  devtools: { enabled: true },
  // head 配置 [ https://nuxt.com/docs/api/configuration/nuxt-config#head ]
  app: {
    head: {
      title: 'nuxt3-demo',
      htmlAttrs: {
        lang: 'en'
      },
      meta: [
        { charset: 'utf-8' },
        { name: 'viewport', content: 'width=device-width, initial-scale=1' },
        { hid: 'description', name: 'description', content: '' },
        { name: 'format-detection', content: 'telephone=no' },
        // 自定义的 meta
        { name: 'description', content: '自定义的 meta 注入' },
        // hid 是一个 meta 的标识，如果在其他页面单独定义时传入了相同的 hid 就会覆盖 meta，否则会同时存在
        { hid: 'abc', name: 'description', content: 'hid-初次' },
      ],
      link: [
        { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
      ],
      // script: []
    }
  },
  alias: {
    '@': resolve(__dirname, '/'),
    // 设置路径别名之后在页面中就可以这样直接引入图片(CSS 中相同)
    // <img src="~img/alias.png" alt="" srcset="">
    'img': fileURLToPath(new URL('./assets/images', import.meta.url))
  },
  css: [
    '~/assets/css/normalize.css',
    '~/assets/css/public.scss'
  ],
  modules: [
    '@element-plus/nuxt',
    '@pinia/nuxt'
  ],
  elementPlus: {

  },
  plugins: [
    './plugins/myPlugin.js',
    './plugins/lifecycle.js',
  ]
})